<?php
/* @var $this DepartmentController */
/* @var $dataProvider CActiveDataProvider */

$this->breadcrumbs=array(
	'User Departments',
);

$this->menu=array(
	array('label'=>'Create UserDepartment', 'url'=>array('create')),
	array('label'=>'Manage UserDepartment', 'url'=>array('admin')),
);
?>

<span class="page_h3">部门列表</span>
<br />
<table cellpadding="1" cellspacing="1" class="c_table">
<tr align="center" class="h" >
	<td>ID</td>
	<td width="250">名称</td>
    <td>部门负责人</td>
    <td>级别</td>
    
    <td>显示</td>
    <td>行政助理</td>
    <td>HR招聘专员</td>
    <td>Action</td>
</tr>

<?php
		foreach ($tree as $key => $value) {
?>

<tr class="<?php echo ($key%2==0)? ('r1') : ('r2');?>"><td><?php echo $value['id']  ?></td>
	<td width="150" >
<?php
	echo str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $value['level']).$value['name'];		
?>
	</td>
    <td><?php echo $value['manager'] .' '. $value['manager_unique_id'] ?></td>
    <td><?php echo $value['level'] ?></td>
    <!--<td><?php //echo Tools::boolImage($value['project_group']); ?></td> -->
    <td><?php echo Tools::boolImage($value['display']); ?></td>
    <td><?php echo $value['admin_assistant'] ?></td>
    <td><?php echo $value['hr_assistant'] ?></td>
    <td align="center"> <a target="_blank" href="<?php echo  Yii::app()->controller->createUrl("department/update",array("id"=>$value['id']));  ?>" ><img  src="<?php echo Yii::app()->request->baseUrl.'/global/img/icons/page_white_edit.png'?>" /></a> </td>
</tr>
<?php
	}
?>
</table>